package routers

import (
	pm "gitee.com/theegg/go-brick/app/middleware/partner_middleware"
	"gitee.com/theegg/go-brick/app/modules/partner_api"
	"gitee.com/theegg/go-brick/app/modules/partner_api/partner_admin"
	"github.com/gin-contrib/gzip"
	"github.com/gin-gonic/gin"
)

var version string = "v1"

func InitPartnerRouter(router *gin.Engine) {

	pApi := router.Group("/ppi")

	partner_admin.InitPartnerAdminAuthRoute(pApi)

	// 需要权限的操作
	pApi.Use(pm.PartnerTokenMiddleware(), pm.PartnerAuthMiddleware(), gzip.Gzip(gzip.DefaultCompression))
	{
		// 登陆后基础信息获取
		partner_api.InitPartnerRoute(pApi)
	}
}
